﻿<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
<%@ include file="../include/top.jsp"%>
<%@ include file="../include/errorArea.jsp"%>
<%@ include file="../include/message-save.jsp" %>
<script type="text/javascript">

$("#community").val("${formdata.community}");
$(function() { 
	 // 任何需要执行的js特效 
	checkBuilding('${ctx}');
	});
	
$(document).ready(function(){
	
	var tablename=document.getElementById("listTable");
	var li=tablename.getElementsByTagName("tr");
	for (var i=1;i<=li.length;i++){
	if (i%2==0){
	li[i].style.backgroundColor="#f6f6f6";
	}else li[i].style.backgroundColor="#FFFFFF";
	}
});
</script>
</head>

<body>

<div class='adduser'>
	<div class='adduser-left'><div class='adduser-icon'></div><span>会员信息</span></div>
</div>
	<form action="${baseURL}/companyAdmin/listUser" method="post">
		  <input type="hidden" name="p" value="1" />
		  <input type="hidden" id="communityId" name="communityId" value="${formdata.community}"/>
		<input type="hidden" id="buildId" name="buildId" value="${formdata.buildNo}"/>
		<input type="hidden" id="unitId" name="unitId" value="${formdata.unitNo}"/>
		<input type="hidden" id="roomId" name="roomId" value="${formdata.roomNo}"/>
		<input type="hidden" id="userId" name="userId" value="${formdata.userNo}"/>
<div class='querycondition'>
	<div class='condtiontitle'><div class='searchcondition'></div>搜索条件：</div>
	<div class='condtion'>
		<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
			 <tr>
   				<td>
			    	小区：<select name="community" id="community" style="width:100px" onchange="checkBuilding('${ctx}');">
			    		<c:forEach var="com" items="${communityList}">
				      		<option value="${com.id}">${com.communityName}</option>
				      	</c:forEach>
			    	</select>楼号：<select name="buildNo" id="buildNo" style="width:100px" onchange="checkUnit('${ctx}');">
			    	<option value="">请选择</option>
			    	<c:forEach var="build" items="${buildingList}">
				      		<option value="${build.id}">${build.buildingCode}</option>
				      	</c:forEach>
			    	</select>单元号：
			    	<select name="unitNo" id="unitNo" style="width:100px" onchange="checkRoom('${ctx}');"></select>
			    	门牌号：<select name="roomNo" id="roomNo" style="width:100px" onchange="checkUser('${ctx}');"></select>
			  
			  <!-- <input name="button" type="submit" value="查找" class="myButton"/> -->
			  <input type='submit' name="button" value='查找' class='button cyan medium'/>	
			   <input type='button' name="export" value='导出用户信息' onclick="exportUser('${ctx}');" class='button cyan medium'/>	
  			</td></tr>
		</table>
	</div>
</div>

<c:if test="${empty obj.list}">
<div align="center"><b>没有符合条件的记录。</b></div>
</c:if>
<c:if test="${not empty obj.list}">
<div class='userlist-title'>
	<div class='userlist-title-left'><div class='userlist-title-icon'></div><span>用户列表</span></div>
</div>
<div class='userlist'>
<table width="94%" border="0" align="center" cellpadding="0" cellspacing="0" id="listTable">
 <tr class='userlist-tr-title'>
		<td class='userlist-td operation' height="25" width="5%"><input type="checkbox" onclick="selectAll(this.checked);"></td>
		<td class='userlist-td operation' width="15%">用户名</td>
		<td class='userlist-td operation' width="15%">小区</td>
		<td class='userlist-td operation' width="10%">楼号</td>
		<td class='userlist-td operation' width="10%">单元号</td>
		<td class='userlist-td operation' width="10%">门牌号</td>
		<td class='userlist-td operation' width="10%">手机号</td>
		<td class='userlist-td operation' width="10%">状态</td>
		<td class='userlist-td operation'>操作</td>
	</tr>
	<c:forEach var="oneRow" items="${obj.list}">
		<tr align="center">
			<td class='userlist-td operation'><input name="chk" type="checkbox" id="chk" value="${oneRow.id}" /></td>
			<td class='userlist-td operation' style="text-align:left;"><label onclick="preCreateUser(${oneRow.id});">${oneRow.username}</label></td>
			<td class='userlist-td operation' style="text-align:left;">${oneRow.communityName}</td>
			<td class='userlist-td operation'>${oneRow.buildingNo}</td>
			<td class='userlist-td operation'>${oneRow.unitNo}</td>
			<td class='userlist-td operation'>${oneRow.roomNo}</td>
			<td class='userlist-td operation'>${oneRow.mobile}</td>
			<td class='userlist-td operation'><c:if test="${oneRow.status==1}">已审核</c:if>
				<c:if test="${oneRow.status!=1}">未审核</c:if></td>
			<td class='userlist-td operation'>
				<c:if test="${oneRow.status!=1}"><a  href="#" onclick="editById('${ctx}',${oneRow.id})">[审核]</a></c:if>
				<!-- <a href="#" onclick="preCreatetrade(${oneRow.id});">[充值]</a> -->
					<a href="#" onclick="preShowtrade(${oneRow.id});">[消费记录]</a>
			</td>
		</tr>
	</c:forEach>
       
</table>
<table>
<tr>
    <td height="5" colspan="2">
    	<input name="button" type="button" onclick="editByIds('${ctx}');" value="批量审核" class='button cyan medium'></td>
  </tr>
  <tr>
    <td height="25" colspan="2"><%@ include file="../include/listpage.jsp"%>
    </td>
  </tr>
</table>
</div>
<script src="${ctx}/js/listCompanyUser.js"></script>
<script src="${ctx}/js/buyProduct.js"></script>
</c:if>
	</form>
	<script>
	function preCreatetrade(uid){
		if(uid!=null && uid!="")
		$.layer({
		    type: 2,
		    maxmin: true,
		    shadeClose: true,
		    title: '会员充值',
		    shade: [0.1,'#fff'],
		    offset: [($(window).height() / 10)+'px',''],
		    area: ['600px', '400px'],
		    iframe: {src: '${ctx}/companyAdmin/addAccountBalance?userNo='+uid}
		}); 
	}
	function preShowtrade(uid){
		if(uid!=null && uid!="")
		$.layer({
		    type: 2,
		    maxmin: true,
		    shadeClose: true,
		    title: '会员消费记录',
		    shade: [0.1,'#fff'],
		    offset: [($(window).height() / 10)+'px',''],
		    area: ['600px', '400px'],
		    iframe: {src: '${ctx}/companyAdmin/showAccountBalance?userNo='+uid}
		}); 
	}
	function preCreateUser(uid){
		if(uid!=null && uid!="")
		$.layer({
		    type: 2,
		    maxmin: true,
		    shadeClose: true,
		    title: '会员详情',
		    shade: [0.1,'#fff'],
		    offset: [($(window).height() / 10)+'px',''],
		    area: ['600px', '400px'],
		    iframe: {src: '${ctx}/companyAdmin/showUser?uid='+uid}
		}); 
	}
	</script>
</body>
</html>
  
